package com.ruoyi.web.controller.ring.app;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ring.domain.dto.GeneralSecondDTO;
import com.ruoyi.ring.service.IEventSubtotalSecondService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 事件小计二级页 app
 */
@Slf4j
@RestController
@RequestMapping("/ring/app/event_subtotal_second")
public class EventSubtotalSecondController extends BaseController {
    @Resource
    private IEventSubtotalSecondService eventSubtotalSecondService;
    /**
     * 查询日历数据列表-app
     */
    @GetMapping("/query-calendar-list")
    public AjaxResult queryCalendarList(GeneralSecondDTO secondDTO){
        long userId = SecurityUtils.getUserId();
        log.info("查询日历数据列表: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventSubtotalSecondService.queryCalendarList(secondDTO));
    }
    /**
     * 二级页 事件小计
     */
    @GetMapping("/query-event-subtotal-list")
    public AjaxResult queryEventSubtotalList(GeneralSecondDTO secondDTO)
    {
        long userId = SecurityUtils.getUserId();
        log.info("事件小计: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return eventSubtotalSecondService.queryEventSubtotalList(secondDTO);
    }
}
